import {ApiFetch} from "../api/apiHandler";
import {BaseUrl} from "../constant/constant";


class ArticleModel {

    constructor() {
        this.url = BaseUrl
    }


    add(params) {
        let end = this.url + 'addarticle'
        let req = new ApiFetch(end)
        return req.fetchByFD(params)
    }

    delete(params) {
        let end = this.url + 'deletearticle'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    get(params) {
        let end = this.url + 'getarticleall'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    update(params) {
        let end = this.url + 'updatearticle'
        let req = new ApiFetch(end)
        return req.fetchByFD(params)
    }
}

export default ArticleModel
